<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
	<title>VODDownload</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
	<meta http-equiv="Access-Control-Allow-Origin" content="*">
	<meta name="page-view-size" content="1280*720"/>
	<meta name="author" content="yangzheng@evmtv.com, 2013-08-26"/>
</head>

<style type="text/css">
body	{margin:0;padding:0;height:100%;}
</style>
</head>

<script type="text/javascript">
$G =
{
	debugMode: 1,

	trace: function( S )
	{
		var E = document.getElementById( 'eINFO' );
		E.innerHTML = S;
	},

	makeMRL: function( S )
	{
		try
		{
			// 分解出资产名
			var assetId = S.replace( /.*\//, '' ).replace( /\.ts/, '.vts' );

			// 根据资产名分配流服务器
			// REAL 开头的视为本地录制内容, 其他视为本地上传内容.
			var vsip,
				vsport = '13142',
				providerId = 'EVMTV';

			if( /^REAL/.test( assetId ))
			{
				vsip = '10.61.3.62';
			}
			else
			{
				vsip = '10.61.3.82';
			}

			var MRL = 'http://' + vsip + '/media/media/' + providerId + '_' + assetId
			return MRL;
		}
		catch( E )
		{
			$G.trace( "Play Error: <br><br>E = '" + E );
		}
	},

	init: function()
	{
		var href = window.location.href;
		var video = href.substring( href.indexOf('movename=')+9, href.length );
		var mrl = this.makeMRL( video );

		$G.trace( "正在准备下载数据, 请稍候....<br>若长时间无响应, 请点击以下链接, 选择“目标另存为”:<br><br>URL = '<a href=\"" + mrl + "\">" + mrl + "</a>'" );
		this.proc( mrl );
	},

	proc: function( MRL )
	{
		location.href = MRL;
	}
}

</script>

<body onload="$G.init()">

<div id="eINFO" style="position:absolute;left:10px;top:30px;font:bold 24px tahoma;color:#f00"></div>

</body>
</html>